<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改</title>
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
    <!--公用样式-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/comment.css">
    <!--页面样式-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/style.css">
    <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/extended.css">
    <script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js"></script>
    <script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
</head>
<style>
    .layui-form-label {
        float: left;
        display: block;
        padding: 9px 15px;
        width: 103px;
        font-weight: 400;
        line-height: 20px;
        text-align: right;
    }
</style>


<body class="whitebg">

<div  style="height: 600px;">
<div class="layui-form-item" style="padding: 30px 0px 10px 0px">
    <div>
        <label class="layui-form-label"><span class="red">*</span>角色</label>
        <div class="layui-input-inline">
            <input type="hidden" value="${greenRole.basePzId}" id="basePzId">
            <select name="roleNo" id="roleNo" style="width: 80% !important;" lay-verify="required">
                <#list roles as vo>
                    <#if "${vo.roleName}"=="${greenRole.roleNo}" >
                        <option value="${vo.roleName}" selected>${vo.remark}</option>
                    <#else >
                        <option value="${vo.roleName}">${vo.remark}</option>
                    </#if>
                </#list>
            </select>
        </div>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label"><span class="red">*</span>左上位置</label>
        <div class="layui-input-inline">
            <select name="data1" id="data1" style="width: 80% !important;" lay-verify="required">
                <option value="">请选择</option>
                <#list mklist as vo>
                    <#if "${vo.badtCode}"=="${greenRole.data1}" >
                        <option value="${vo.badtCode}" selected>${vo.badtName}</option>
                    <#else >
                        <option value="${vo.badtCode}">${vo.badtName}</option>
                    </#if>
                </#list>
            </select>
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label"><span class="red">*</span>优先级</label>
        <div class="layui-input-inline">
            <select name="dataLv1" id="dataLv1" style="width: 90% !important;" lay-verify="required">
                <#list mkyxlist as vo>
                    <#if "${vo.badtCode}"=="${greenRole.dataLv1}" >
                        <option value="${vo.badtCode}" selected>${vo.badtName}</option>
                    <#else >
                        <option value="${vo.badtCode}">${vo.badtName}</option>
                    </#if>
                </#list>
            </select>
        </div>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label"><span class="red">*</span>左中位置</label>
        <div class="layui-input-inline">
            <select name="data2" id="data2" style="width: 80% !important;" lay-verify="required">
                <option value="">请选择</option>
                <#list mklist as vo>
                    <#if "${vo.badtCode}"=="${greenRole.data2}" >
                        <option value="${vo.badtCode}" selected>${vo.badtName}</option>
                    <#else >
                        <option value="${vo.badtCode}">${vo.badtName}</option>
                    </#if>>
                </#list>
            </select>
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label"><span class="red">*</span>优先级</label>
        <div class="layui-input-inline">
            <select name="dataLv2" id="dataLv2" style="width: 90% !important;" lay-verify="required">
                <#list mkyxlist as vo>
                    <#if "${vo.badtCode}"=="${greenRole.dataLv2}" >
                        <option value="${vo.badtCode}" selected>${vo.badtName}</option>
                    <#else >
                        <option value="${vo.badtCode}">${vo.badtName}</option>
                    </#if>
                </#list>
            </select>
        </div>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label"><span class="red">*</span>左下位置</label>
        <div class="layui-input-inline">
            <select name="data3" id="data3" style="width: 80% !important;" lay-verify="required">
                <option value="">请选择</option>
                <#list mklist as vo>
                    <#if "${vo.badtCode}"=="${greenRole.data3}" >
                        <option value="${vo.badtCode}" selected>${vo.badtName}</option>
                    <#else >
                        <option value="${vo.badtCode}">${vo.badtName}</option>
                    </#if>>
                </#list>
            </select>
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label"><span class="red">*</span>优先级</label>
        <div class="layui-input-inline">
            <select name="dataLv3" id="dataLv3" style="width: 90% !important;" lay-verify="required">
                <#list mkyxlist as vo>
                    <#if "${vo.badtCode}"=="${greenRole.dataLv3}" >
                        <option value="${vo.badtCode}" selected>${vo.badtName}</option>
                    <#else >
                        <option value="${vo.badtCode}">${vo.badtName}</option>
                    </#if>
                </#list>
            </select>
        </div>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label"><span class="red">*</span>右上位置</label>
        <div class="layui-input-inline">
            <select name="data4" id="data4" style="width: 80% !important;" lay-verify="required">
                <option value="">请选择</option>
                <#list mklist as vo>
                    <#if "${vo.badtCode}"=="${greenRole.data4}" >
                        <option value="${vo.badtCode}" selected>${vo.badtName}</option>
                    <#else >
                        <option value="${vo.badtCode}">${vo.badtName}</option>
                    </#if>
                </#list>
            </select>
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label"><span class="red">*</span>优先级</label>
        <div class="layui-input-inline">
            <select name="dataLv4" id="dataLv4" style="width: 90% !important;" lay-verify="required">
                <#list mkyxlist as vo>
                    <#if "${vo.badtCode}"=="${greenRole.dataLv4}" >
                        <option value="${vo.badtCode}" selected>${vo.badtName}</option>
                    <#else >
                        <option value="${vo.badtCode}">${vo.badtName}</option>
                    </#if>
                </#list>
            </select>
        </div>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label"><span class="red">*</span>右中位置</label>
        <div class="layui-input-inline">
            <select name="data5" id="data5" style="width: 80% !important;" lay-verify="required">
                <option value="">请选择</option>
                <#list mklist as vo>
                    <#if "${vo.badtCode}"=="${greenRole.data5}" >
                        <option value="${vo.badtCode}" selected>${vo.badtName}</option>
                    <#else >
                        <option value="${vo.badtCode}">${vo.badtName}</option>
                    </#if>>
                </#list>
            </select>
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label"><span class="red">*</span>优先级</label>
        <div class="layui-input-inline">
            <select name="dataLv5" id="dataLv5" style="width: 90% !important;" lay-verify="required">
                <#list mkyxlist as vo>
                    <#if "${vo.badtCode}"=="${greenRole.dataLv5}" >
                        <option value="${vo.badtCode}" selected>${vo.badtName}</option>
                    <#else >
                        <option value="${vo.badtCode}">${vo.badtName}</option>
                    </#if>
                </#list>
            </select>
        </div>

    </div>
</div>
<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label"><span class="red">*</span>右下位置</label>
        <div class="layui-input-inline">
            <select name="data6" id="data6" style="width: 80% !important;" lay-verify="required">
                <option value="">请选择</option>
                <#list mklist as vo>
                    <#if "${vo.badtCode}"=="${greenRole.data6}" >
                        <option value="${vo.badtCode}" selected>${vo.badtName}</option>
                    <#else >
                        <option value="${vo.badtCode}">${vo.badtName}</option>
                    </#if>>
                </#list>
            </select>
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label"><span class="red">*</span>优先级</label>
        <div class="layui-input-inline">
            <select name="dataLv6" id="dataLv6" style="width: 90% !important;" lay-verify="required">
                <#list mkyxlist as vo>
                    <#if "${vo.badtCode}"=="${greenRole.dataLv6}" >
                        <option value="${vo.badtCode}" selected>${vo.badtName}</option>
                    <#else >
                        <option value="${vo.badtCode}">${vo.badtName}</option>
                    </#if>
                </#list>
            </select>
        </div>
    </div>
</div>
<div style="background-color: white;background-color: white;padding: 15px;text-align: center;position: fixed;bottom: 1px;width: 100%;">
    <button class="layui-btn layui-btn-sm" lay-filter="submitType" lay-submit type="button">保存</button>
    <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" id="close">取消</button>
</div>
</div>

<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<script>

    layui.use(['form', 'layer'], function () {
        $ = layui.jquery;
        var form = layui.form
            , layer = layui.layer;

        $('#close').click(function () {
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        });
        //监听提交

        form.on('submit(submitType)', function (data) {
            var basePzId = $("#basePzId").val();
            var roleNo = $("#roleNo").val();
            var data1 = $("#data1").val();
            var data2 = $("#data2").val();
            var data3 = $("#data3").val();
            var data4 = $("#data4").val();
            var data5 = $("#data5").val();
            var data6 = $("#data6").val();
            var dataLv1 = $("#dataLv1").val();
            var dataLv2 = $("#dataLv2").val();
            var dataLv3 = $("#dataLv3").val();
            var dataLv4 = $("#dataLv4").val();
            var dataLv5 = $("#dataLv5").val();
            var dataLv6 = $("#dataLv6").val();
            var json = {
                basePzId: basePzId,
                roleNo: roleNo,
                data1: data1,
                data2: data2,
                data3: data3,
                data4: data4,
                data5: data5,
                data6: data6,
                dataLv1: dataLv1,
                dataLv2: dataLv2,
                dataLv3: dataLv3,
                dataLv4: dataLv4,
                dataLv5: dataLv5,
                dataLv6: dataLv6
            }
            layerAjax('/search/BigScreen/updateBigRole', json, '',
                function (d) {
                    if (d.flag == true) {
                        parent.layer.msg('操作成功', {icon: 1});
                    } else {
                        layer.msg(d.msg, {icon: 2});
                    }
                });
            return false;
        });
    });

    function addOneDic(dicts, ind) {
        debugger;
        if (!dicts[ind]) {
            return;
        }
        if (ind == 0) {
            var type = localStorage.getItem("currentType");
            if (type) {
                layerAjax('/sys/dict/deleteDictByTypeCode', {dictTypeCode: type});
            }
        }
        var json = {
            badtTypecode: localStorage.getItem("currentType"),
            badtCode: dicts[ind].id,
            badtName: dicts[ind].name
        }
        layerAjax('/sys/dict/addDictValue', json, '',
            function (d) {
                if (d.flag == true) {
                    if (ind == (dicts.length - 1)) {
                        parent.layer.msg('操作成功', {icon: 1});
                        localStorage.removeItem('checkeddicnodes');
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                        parent.flushDictList();
                    }
                } else {
                    layer.msg(d.msg, {icon: 2});
                }
            });
        if (ind < dicts.length) {
            ind++;
            addOneDic(dicts, ind);
        }
    }

</script>
</body>
</html>